<template>
  <div>
    <report-form ref="reportForm" @search="handleSearch" @addUser="handleAddUser" />
    <report-table ref="reportTable" @edit="handleEdit" />
    <archives-modal ref="archivesModal" @refresh="handleRefresh" />
  </div>
</template>

<script>
import ReportForm from './ReportForm'
import ReportTable from './ReportTable'
import ArchivesModal from './ArchivesModal'
export default {
  components: {
    ReportForm,
    ReportTable,
    ArchivesModal
  },
  methods: {
    handleRefresh() {
      this.$refs.reportTable.handleGetList()
    },
    handleSearch(obj) {
      this.$refs.reportTable.handleGetList(obj)
    },
    handleAddUser() {
      this.$refs.archivesModal.edit(false, {})
    },
    handleEdit(bool, obj) {
      this.$refs.archivesModal.edit(bool, obj)
    }
  }
}
</script>
